package net.yegong.mva.pca;

/**
 * @author cooper
 */
public class PCACalcFactory {

	/**
	 * @param algorithm the name the algorithm, it can be Auto,PCA,Kernel PCA or
	 *            CCIPCA
	 * @return the PCACalc implementation
	 */
	public static PCACalc createPCACalc(String algorithm) {
		if (algorithm.equals("PCA")) {
			return new NormalEVDPCACalc();
		}
		if (algorithm.equals("CCIPCA")) {
			return new CCIPCACalc();
		}
		throw new IllegalArgumentException("No such algorithm :" + algorithm + " for pca");
	}
}
